Skip to content

refactor(client:main): use controller as, named function, new name #1243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2015

Conversation

Awk34
Copy link
Member

@Awk34 Awk34 commented Sep 2, 2015

controller as main, MainCtrl -> MainController

@Awk34 Awk34 added this to the 3.0.0 milestone Sep 2, 2015
@Awk34 Awk34 force-pushed the angular-controller-as branch from 9c3e3e3 to 17af68f Compare September 3, 2015 00:32
@@ -6,10 +6,12 @@ angular.module '<%= scriptAppName %>'
.when '/',
templateUrl: 'app/main/main.html'
controller: 'MainCtrl'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be MainController

@Awk34 Awk34 force-pushed the angular-controller-as branch 2 times, most recently from a959473 to bcf664f Compare September 3, 2015 18:23
@Awk34
Copy link
Member Author

Awk34 commented Sep 4, 2015

@kingcody I'm having trouble figuring out why that last test case is failing with CoffeeScript. Mind taking a look?


MainController = ($scope, $http<% if (filters.socketio) { %>, socket<% } %>) ->
self = this
@awesomeThings = []
$http.get('/api/things').then (response) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With no server options this is the last statement in the controller and coffee returns the last statement in a function. Also, when using controller as syntax if the controller returns a value then it is bound to the scope as the controller. So this should be the last statement.

@Awk34 Awk34 force-pushed the angular-controller-as branch 3 times, most recently from ff51c05 to c8038ce Compare September 10, 2015 18:41
@Awk34
Copy link
Member Author

Awk34 commented Sep 10, 2015

Requires #1287

controller as main, MainCtrl -> MainController
@kingcody kingcody force-pushed the angular-controller-as branch from c8038ce to 7d7daee Compare September 12, 2015 08:53
kingcody added a commit that referenced this pull request Sep 12, 2015
refactor(client:main): use controller as, named function, new name
@kingcody kingcody merged commit f5c4048 into canary Sep 12, 2015
@Awk34 Awk34 deleted the angular-controller-as branch December 14, 2015 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants